Skip to content

feat(config): enable startup logs by default#7474

Merged
bm1549 merged 6 commits intomasterfrom
brian.marks/startup-log-default-enablement
Mar 18, 2026
Merged

feat(config): enable startup logs by default#7474
bm1549 merged 6 commits intomasterfrom
brian.marks/startup-log-default-enablement

Conversation

@bm1549
Copy link
Copy Markdown
Contributor

@bm1549 bm1549 commented Feb 10, 2026

What does this PR do?

Enable startup logs by default for dd-trace v6+, gated behind a DD_MAJOR >= 6 version check so the change is safely backportable to v5.

Motivation

Startup logs provide helpful diagnostic information about tracer configuration. Currently they must be explicitly enabled via DD_TRACE_STARTUP_LOGS=true. By enabling them by default, we make it easier for users to diagnose configuration issues and understand their tracer setup.

Main benefits:

  1. Installing our libraries is hard for some users and is error-prone. Providing an on-by-default log as a heartbeat gives folks the confidence that the SDK was installed.
  2. Changing configs is often the second battle. Having the startup log off-by-default with a config to turn it on effectively couples installing and configuring. Users can end up not knowing if the tracer isn't installed or if the config isn't being set properly.
  3. Moving to stderr (fix(startup-log): send startup logs to stderr #7502) makes this much less risky since other dependencies may also log to stderr.
  4. Consistency with other languages. Nearly every other Datadog tracer has logging to console on by default, confirmed by Add tests for startup log behavior in tracer libraries system-tests#6241

Additional Notes

  • The default change is gated behind DD_MAJOR >= 6 in defaults.js so it is safely backportable (v5 retains startupLogs: false)
  • supported-configurations.json keeps the canonical default as false (implementation level D), with the runtime override in defaultsWithConditionalRuntimeBehavior
  • Users who want to opt out can set DD_TRACE_STARTUP_LOGS=false

Test plan:

  • Config defaults test updated and passing (197/197)
  • RASP integration tests set DD_TRACE_STARTUP_LOGS=false to avoid interference

🤖 Generated with Claude Code

@bm1549 bm1549 requested a review from a team as a code owner February 10, 2026 14:12
@bm1549 bm1549 requested review from khanayan123 and removed request for a team February 10, 2026 14:12
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.45%. Comparing base (141cbf6) to head (63a1ba1).
⚠️ Report is 17 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7474      +/-   ##
==========================================
+ Coverage   80.23%   80.45%   +0.22%     
==========================================
  Files         748      748              
  Lines       32405    32412       +7     
==========================================
+ Hits        25999    26078      +79     
+ Misses       6406     6334      -72     
Flag Coverage Δ
aiguard-macos 39.25% <100.00%> (+0.07%) ⬆️
aiguard-ubuntu 39.36% <100.00%> (+0.07%) ⬆️
aiguard-windows 39.06% <100.00%> (+0.04%) ⬆️
apm-capabilities-tracing-macos 48.87% <100.00%> (-0.03%) ⬇️
apm-capabilities-tracing-ubuntu 48.95% <100.00%> (+<0.01%) ⬆️
apm-capabilities-tracing-windows 48.68% <100.00%> (+<0.01%) ⬆️
apm-integrations-child-process 38.55% <100.00%> (+0.07%) ⬆️
apm-integrations-couchbase-18 37.29% <100.00%> (-0.10%) ⬇️
apm-integrations-couchbase-eol 37.93% <100.00%> (+0.07%) ⬆️
apm-integrations-oracledb 37.74% <100.00%> (+0.03%) ⬆️
appsec-express 55.26% <100.00%> (+0.02%) ⬆️
appsec-fastify 51.61% <100.00%> (+0.02%) ⬆️
appsec-graphql 51.81% <100.00%> (+0.02%) ⬆️
appsec-kafka 44.40% <100.00%> (+0.06%) ⬆️
appsec-ldapjs 44.01% <100.00%> (+0.02%) ⬆️
appsec-lodash 43.64% <100.00%> (-0.01%) ⬇️
appsec-macos 58.22% <100.00%> (+0.05%) ⬆️
appsec-mongodb-core 48.79% <100.00%> (+0.03%) ⬆️
appsec-mongoose 49.45% <100.00%> (+0.03%) ⬆️
appsec-mysql 50.89% <100.00%> (+0.04%) ⬆️
appsec-node-serialize 43.19% <100.00%> (+0.02%) ⬆️
appsec-passport 47.65% <100.00%> (+0.03%) ⬆️
appsec-postgres 50.61% <100.00%> (+0.04%) ⬆️
appsec-sourcing 42.62% <100.00%> (+0.03%) ⬆️
appsec-template 43.36% <100.00%> (+0.02%) ⬆️
appsec-ubuntu 58.30% <100.00%> (+0.05%) ⬆️
appsec-windows 58.05% <100.00%> (+0.01%) ⬆️
instrumentations-instrumentation-bluebird 32.34% <100.00%> (-0.03%) ⬇️
instrumentations-instrumentation-body-parser 40.53% <100.00%> (+0.03%) ⬆️
instrumentations-instrumentation-child_process 37.84% <100.00%> (+0.04%) ⬆️
instrumentations-instrumentation-cookie-parser 34.30% <100.00%> (-0.03%) ⬇️
instrumentations-instrumentation-express 34.62% <100.00%> (-0.03%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 34.43% <100.00%> (-0.03%) ⬇️
instrumentations-instrumentation-express-session 40.16% <100.00%> (+0.03%) ⬆️
instrumentations-instrumentation-fs 31.96% <100.00%> (-0.03%) ⬇️
instrumentations-instrumentation-generic-pool 29.52% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-http 39.81% <100.00%> (+0.03%) ⬆️
instrumentations-instrumentation-knex 32.34% <100.00%> (-0.03%) ⬇️
instrumentations-instrumentation-mongoose 33.46% <100.00%> (-0.03%) ⬇️
instrumentations-instrumentation-multer 40.28% <100.00%> (+0.03%) ⬆️
instrumentations-instrumentation-mysql2 38.29% <100.00%> (+0.04%) ⬆️
instrumentations-instrumentation-passport 44.06% <100.00%> (+0.02%) ⬆️
instrumentations-instrumentation-passport-http 43.74% <100.00%> (+0.03%) ⬆️
instrumentations-instrumentation-passport-local 44.27% <100.00%> (+0.03%) ⬆️
instrumentations-instrumentation-pg 37.73% <100.00%> (+0.04%) ⬆️
instrumentations-instrumentation-promise 32.27% <100.00%> (-0.03%) ⬇️
instrumentations-instrumentation-promise-js 32.28% <100.00%> (-0.03%) ⬇️
instrumentations-instrumentation-q 32.32% <100.00%> (-0.03%) ⬇️
instrumentations-instrumentation-url 32.24% <100.00%> (-0.03%) ⬇️
instrumentations-instrumentation-when 32.29% <100.00%> (-0.03%) ⬇️
llmobs-ai 42.26% <100.00%> (+0.03%) ⬆️
llmobs-anthropic 40.30% <100.00%> (+0.03%) ⬆️
llmobs-bedrock 39.25% <100.00%> (+0.03%) ⬆️
llmobs-google-genai 39.79% <100.00%> (+0.03%) ⬆️
llmobs-langchain 40.04% <100.00%> (+0.03%) ⬆️
llmobs-openai 43.98% <100.00%> (+0.04%) ⬆️
llmobs-vertex-ai 40.05% <100.00%> (+0.03%) ⬆️
platform-core 31.47% <ø> (ø)
platform-esbuild 34.42% <ø> (ø)
platform-instrumentations-misc 48.41% <ø> (ø)
platform-shimmer 37.56% <ø> (ø)
platform-unit-guardrails 32.89% <ø> (ø)
plugins-azure-durable-functions 25.74% <ø> (ø)
plugins-azure-event-hubs 25.90% <ø> (ø)
plugins-azure-service-bus 25.26% <ø> (ø)
plugins-bullmq 44.32% <100.00%> (+0.06%) ⬆️
plugins-cassandra 37.78% <100.00%> (+0.03%) ⬆️
plugins-cookie 26.96% <ø> (ø)
plugins-cookie-parser 26.75% <ø> (ø)
plugins-crypto 26.73% <ø> (ø)
plugins-dd-trace-api 38.31% <100.00%> (+<0.01%) ⬆️
plugins-express-mongo-sanitize 26.89% <ø> (ø)
plugins-express-session 26.70% <ø> (ø)
plugins-fastify 42.25% <100.00%> (+0.04%) ⬆️
plugins-fetch 38.36% <100.00%> (+0.06%) ⬆️
plugins-fs 38.65% <100.00%> (+0.07%) ⬆️
plugins-generic-pool 25.94% <ø> (ø)
plugins-google-cloud-pubsub 45.47% <100.00%> (+0.06%) ⬆️
plugins-grpc 40.91% <100.00%> (+0.03%) ⬆️
plugins-handlebars 26.94% <ø> (ø)
plugins-hapi 40.16% <100.00%> (+0.03%) ⬆️
plugins-hono 40.42% <100.00%> (+0.03%) ⬆️
plugins-ioredis 38.46% <100.00%> (+0.07%) ⬆️
plugins-knex 26.57% <ø> (ø)
plugins-langgraph 38.47% <100.00%> (+0.04%) ⬆️
plugins-ldapjs 24.43% <ø> (ø)
plugins-light-my-request 26.30% <ø> (ø)
plugins-limitd-client 32.61% <100.00%> (-0.03%) ⬇️
plugins-lodash 26.03% <ø> (ø)
plugins-mariadb 39.50% <100.00%> (+0.06%) ⬆️
plugins-memcached 38.16% <100.00%> (+0.05%) ⬆️
plugins-microgateway-core 39.23% <100.00%> (+0.03%) ⬆️
plugins-moleculer 40.55% <100.00%> (+0.07%) ⬆️
plugins-mongodb 39.17% <100.00%> (+0.04%) ⬆️
plugins-mongodb-core 39.01% <100.00%> (+0.04%) ⬆️
plugins-mongoose 38.88% <100.00%> (+0.06%) ⬆️
plugins-multer 26.70% <ø> (ø)
plugins-mysql 39.20% <100.00%> (+0.07%) ⬆️
plugins-mysql2 39.29% <100.00%> (+0.07%) ⬆️
plugins-node-serialize 27.00% <ø> (ø)
plugins-opensearch 37.61% <100.00%> (+0.03%) ⬆️
plugins-passport-http 26.76% <ø> (ø)
plugins-postgres 35.58% <100.00%> (+0.03%) ⬆️
plugins-process 26.73% <ø> (ø)
plugins-pug 26.96% <ø> (ø)
plugins-redis 38.92% <100.00%> (+0.21%) ⬆️
plugins-router 42.97% <100.00%> (-0.10%) ⬇️
plugins-sequelize 25.55% <ø> (ø)
plugins-test-and-upstream-amqp10 38.51% <100.00%> (+0.18%) ⬆️
plugins-test-and-upstream-amqplib 43.90% <100.00%> (+0.06%) ⬆️
plugins-test-and-upstream-apollo 39.12% <100.00%> (+0.03%) ⬆️
plugins-test-and-upstream-avsc 38.61% <100.00%> (-0.01%) ⬇️
plugins-test-and-upstream-bunyan 33.87% <100.00%> (-0.03%) ⬇️
plugins-test-and-upstream-connect 40.82% <100.00%> (+0.03%) ⬆️
plugins-test-and-upstream-graphql 40.14% <100.00%> (+0.06%) ⬆️
plugins-test-and-upstream-koa 40.41% <100.00%> (+0.03%) ⬆️
plugins-test-and-upstream-protobufjs 38.83% <100.00%> (-0.01%) ⬇️
plugins-test-and-upstream-rhea 44.05% <100.00%> (+0.03%) ⬆️
plugins-undici 39.13% <100.00%> (+0.06%) ⬆️
plugins-url 26.73% <ø> (ø)
plugins-valkey 38.12% <100.00%> (+0.07%) ⬆️
plugins-vm 26.73% <ø> (ø)
plugins-winston 34.06% <100.00%> (-0.03%) ⬇️
plugins-ws 41.90% <100.00%> (+0.07%) ⬆️
profiling-macos 40.56% <100.00%> (+0.69%) ⬆️
profiling-ubuntu 40.68% <100.00%> (+0.69%) ⬆️
profiling-windows 41.81% <100.00%> (+0.24%) ⬆️
serverless-azure-functions-client 25.62% <ø> (ø)
serverless-azure-functions-eventhubs 25.62% <ø> (ø)
serverless-azure-functions-servicebus 25.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bm1549 bm1549 requested a review from BridgeAR February 10, 2026 14:13
@bm1549 bm1549 marked this pull request as draft February 10, 2026 14:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 10, 2026

Overall package size

Self size: 4.97 MB
Deduped: 5.82 MB
No deduping: 5.82 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.0 | 81.15 kB | 815.98 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@datadog-datadog-prod-us1

This comment has been minimized.

@bm1549 bm1549 added adms-minor-update AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos and removed adms-minor-update labels Feb 10, 2026
@bm1549 bm1549 requested a review from a team March 5, 2026 23:08
Changed the default value of startupLogs from false to true. Startup logs
provide helpful diagnostic information about tracer configuration and should
be enabled by default to improve observability and debugging experience.

Changes:
- Updated supported-configurations.json to set startupLogs default to true
- Updated config test expectations to reflect new default

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bm1549 bm1549 force-pushed the brian.marks/startup-log-default-enablement branch from b04e3d1 to 294f91f Compare March 6, 2026 18:43
@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Mar 6, 2026

Benchmarks

Benchmark execution time: 2026-03-18 15:34:35

Comparing candidate commit 63a1ba1 in PR branch brian.marks/startup-log-default-enablement with baseline commit 141cbf6 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 232 metrics, 28 unstable metrics.

bm1549 and others added 3 commits March 16, 2026 20:22
The startup log line was being captured by the stdioHandler and
triggering "Unexpected output in stdout/stderr after blocking request"
assertion failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bm1549 bm1549 marked this pull request as ready for review March 17, 2026 01:11
@bm1549 bm1549 requested a review from a team as a code owner March 17, 2026 01:11
@simon-id
Copy link
Copy Markdown
Member

-1 on this, but either way, we implement breaking changes with version checks like so:

if (libVersion.major >= 6) {
  default = true
} else {
  default = false
}

this is due to us having to maintain multiple release branches at the same time, and making the breaking changes without this system would result in constant merge conflicts.

Copy link
Copy Markdown
Member

@rochdev rochdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking changes must be behind a flag as we share code between versions.

Not related to the code but still worth mentioning: our current tooling also struggles with the semver-major label. It's something we plan to address soon, but in the meantime this should be moved to semver-minor and added to the 6.0.0 milestone so we list it properly in the breaking changes in the next release.

Breaking changes must be behind a version flag since code is shared
between versions. Keep supported-configurations.json default as false
and override in defaults.js with DD_MAJOR >= 6 so v5 retains the
original behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bm1549 bm1549 added this to the 6.0.0 milestone Mar 17, 2026
DD_APPSEC_RASP_ENABLED: 'true',
DD_APPSEC_RULES: path.join(cwd, 'appsec/rasp/rasp_rules.json'),
DD_APPSEC_RASP_COLLECT_REQUEST_BODY: String(collectRequestBody),
DD_TRACE_STARTUP_LOGS: 'false',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appsec test makes sure that no logs exist when blocking a request. Rather than patching it to ignore the DD startup log, this seemed more correct

@bm1549 bm1549 requested a review from rochdev March 17, 2026 15:36
@bm1549 bm1549 removed this from the 6.0.0 milestone Mar 17, 2026
Copy link
Copy Markdown
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am happy to see this coming soon for v6

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bm1549 bm1549 requested a review from BridgeAR March 18, 2026 15:48
Copy link
Copy Markdown
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gh-worker-ownership-write-b05516 gh-worker-ownership-write-b05516 bot removed the request for review from rochdev March 18, 2026 16:16
@bm1549 bm1549 requested a review from rochdev March 18, 2026 16:27
@bm1549 bm1549 merged commit 46aa1f0 into master Mar 18, 2026
787 checks passed
@bm1549 bm1549 deleted the brian.marks/startup-log-default-enablement branch March 18, 2026 17:03
dd-octo-sts bot pushed a commit that referenced this pull request Mar 19, 2026
* feat(config): enable startup logs by default

Changed the default value of startupLogs from false to true. Startup logs
provide helpful diagnostic information about tracer configuration and should
be enabled by default to improve observability and debugging experience.

Changes:
- Updated supported-configurations.json to set startupLogs default to true
- Updated config test expectations to reflect new default

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(test): disable startup logs in RASP integration tests

The startup log line was being captured by the stdioHandler and
triggering "Unexpected output in stdout/stderr after blocking request"
assertion failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(config): update DD_TRACE_STARTUP_LOGS implementation level to C

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(config): gate startup logs default behind DD_MAJOR version check

Breaking changes must be behind a version flag since code is shared
between versions. Keep supported-configurations.json default as false
and override in defaults.js with DD_MAJOR >= 6 so v5 retains the
original behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test(config): use DD_MAJOR to determine startupLogs default in tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@dd-octo-sts dd-octo-sts bot mentioned this pull request Mar 19, 2026
bengl pushed a commit that referenced this pull request Mar 23, 2026
* feat(config): enable startup logs by default

Changed the default value of startupLogs from false to true. Startup logs
provide helpful diagnostic information about tracer configuration and should
be enabled by default to improve observability and debugging experience.

Changes:
- Updated supported-configurations.json to set startupLogs default to true
- Updated config test expectations to reflect new default

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(test): disable startup logs in RASP integration tests

The startup log line was being captured by the stdioHandler and
triggering "Unexpected output in stdout/stderr after blocking request"
assertion failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(config): update DD_TRACE_STARTUP_LOGS implementation level to C

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(config): gate startup logs default behind DD_MAJOR version check

Breaking changes must be behind a version flag since code is shared
between versions. Keep supported-configurations.json default as false
and override in defaults.js with DD_MAJOR >= 6 so v5 retains the
original behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test(config): use DD_MAJOR to determine startupLogs default in tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos semver-minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants